const { userInputNotFound, ooMandatoryParametersError } = require("../main/err.type");

const VerifyCreateBranchProjectInput = async (ctx, next) => {
    console.log(ctx.request.body);
    if (!ctx.request.body) {
        ctx.body = userInputNotFound;
        return ctx.app.emit("error", userInputNotFound, ctx);
    }
    //  projectId, branchId,projectName,projectLeader
    const { projectId, branchId, projectName, projectLeader } = ctx.request.body;
    console.log(projectId, branchId, projectName, projectLeader,'projectId, branchId, projectName, projectLeader');
    if (!projectId || !branchId || !projectName || !projectLeader) {
        ctx.body = ooMandatoryParametersError;
        return ctx.app.emit("error", ooMandatoryParametersError, ctx);
    } else {
        await next();
    }
};
module.exports = {
    VerifyCreateBranchProjectInput,
};
